package com.decent.entity;

import com.decent.constant.Constants;
import com.decent.enums.enums.StockLanguageTypeEnum;
import com.decent.enums.enums.StockStatusEnum;
import com.decent.enums.enums.StockTypeEnum;
import com.decent.enums.enums.StockVersionTypeEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.redis.core.RedisTemplate;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 商品库存
 *
 * @author wangyx
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Stock implements Serializable {
    private static final long serialVersionUID = 4073602715708872881L;
    /**
     * 自增ID
     */
    private Long id;
    /**
     * 回收订单ID
     */
    private Long orderId;
    /**
     * 商品ID
     */
    private Long productId;
    /**
     * 成本
     */
    private BigDecimal cost;
    /**
     * 创建时间
     */
    private LocalDateTime createTime;
    /**
     * 入库时间
     */
    private LocalDateTime inTime;
    /**
     * 库存编号
     */
    private String stockNo;
    /**
     * 库存属性
     */
    private StockTypeEnum stockType;
    /**
     * 语言属性
     */
    private StockLanguageTypeEnum languageType;
    /**
     * 版本属性
     */
    private StockVersionTypeEnum versionType;
    /**
     * 状态
     */
    private StockStatusEnum stockStatus;
    /**
     * 出库时间
     */
    @JsonFormat(pattern = Constants.DATE_TIME_FORMAT, timezone = Constants.TIMEZONE)
    private LocalDateTime outTime;
    /**
     * 进货单id
     */
    private Long inSheetId;
    /**
     * 采购单、销售单id
     */
    private Long outSheetId;
    /**
     * 货位id
     */
    private Long locationId;
    /**
     * 货架id
     */
    private Long shelvesId;
    /**
     * 库存语言为OTHER的内容
     */
    private String stockLanguageOther;
    /**
     * 非国行版本备注
     */
    private String stockVersionRemark;
    /**
     * 闲鱼库存编号
     */
    private String xyStockNo;
    /**
     * 代理商ID
     */
    private Long proxyId;
}
